/**
 * Apr 3, 2010
 */
package org.tomale.id.common;

import java.util.List;

/**
 * @author ferd
 *
 */
public class Helper {

	public static KeyValuePair<String, String> getPairByKey(final List<KeyValuePair<String, String>> pairs,
			final String key){
		for(KeyValuePair<String, String> kv : pairs){
			if(key.equals(kv.getKey())){
				return kv;
			}
		}
		return null;
	}

	public static KeyValuePair<String, String> getPairByValue(final List<KeyValuePair<String, String>> pairs,
			final String value){
		for(KeyValuePair<String, String> kv : pairs){
			if(value.equals(kv.getValue())){
				return kv;
			}
		}
		return null;
	}

}
